<script setup>
  import {Login} from "../../wailsjs/go/backend/App.js";
  import {reactive} from "vue";
  import {bo} from "../../wailsjs/go/models.ts";
  const data = reactive({
    result:"hello"
  })
  const loginForm = reactive({
    username: "",
    password: ""
  })

  function login() {
    const params = bo.LoginBo.createFrom(loginForm)
    Login(params).then((res) => {
      data.result = res
    })
  }
</script>

<template>
  <span>登录</span>
  <div id="result" class="result">{{ data.result }}</div>
  <el-form>
    <el-form-item label="username">
        <el-input v-model="loginForm.username"></el-input>
    </el-form-item>
    <el-form-item label="password">
      <el-input v-model="loginForm.password"></el-input>
    </el-form-item>
    <el-form-item>
      <el-button-group>
        <el-button  type="primary" @click="login">登录</el-button>
      </el-button-group>
    </el-form-item>
  </el-form>
</template>

<style scoped>

</style>